Attribute VB_Name = "dicApi"
'    23/03/2007 - 20.15
'    Progetto1.vbp - Dialisi
'    dicApi.bas - dicApi
'    Modulo
'    Funzione: Gestione API

Option Explicit

'Per il collegamento al sito
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


' usato per spostare il cursore alla fine di una txtBox
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

' per determinare la posizione del form Calndario e orario e altri
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long


' per poter spostare il form Calendario
Public Declare Sub ReleaseCapture Lib "user32" ()
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal Wparam As Long, Lparam As Any) As Long

' per eliminare la x nel form login
Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, ByVal bRevert As Long) As Long
Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPosition As Long, _
ByVal wFlags As Long) As Long

' per caricare tutti i driver
Public Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" _
    (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" _
    (ByVal nDrive As String) As Long

' per caricare le info sul driver

Public Declare Function GetVolumeInformation& Lib "kernel32" Alias _
    "GetVolumeInformationA" (ByVal lpRootPathName As String, _
    ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _
    lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
    lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
    ByVal nFileSystemNameSize As Long)
    
    
' per determinare lo spazio libero su disco
Public Declare Function GetDiskFreeSpace_FAT32 _
    Lib "kernel32" Alias "GetDiskFreeSpaceExA" _
    (ByVal lpRootPathName As String, _
    FreeBytesToCaller As Currency, BytesTotal _
    As Currency, FreeBytesTotal As Currency) _
    As Long

' per lo zoom nel report
Public Declare Function GetWindowLong _
                Lib "user32" _
                Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Public Declare _
    Function GetWindow _
    Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
' zoom nel report
Public Const CBN_SELCHANGE As Long = 1
Public Const GWL_ID = (-12)
Public Const WM_COMMAND = &H111
Public Const GW_CHILD = 5
Public Const GW_HWNDNEXT = 2
Public Const CB_SELECTSTRING As Long = &H14D


Public Const KEYEVENTF_EXTENDEDKEY = &H1        'pressione del tasto (keyDown)
Public Const KEYEVENTF_KEYUP = &H2             'rilascio del tasto premuto (keyUp)
Public Const VK_TAB = &H9

Public Type POINTAPI
    X As Long
    Y As Long
End Type

Public Const WM_NCLBUTTONDOWN = &HA1
Public Const HTCAPTION = 2

Public Const MF_BYPOSITION = &H400&

Public Const CB_SETDROPPEDWIDTH = &H160


Public Const DRIVE_REMOVABLE = 2
Public Const MAX_PATH = 260
